package window;

import java.util.Arrays;

import org.junit.Test;

import utils.ArrayGenerator;

public class Ex1299 {
    class Solution {
        public int[] replaceElements(int[] arr) {
            int max = -1, idx = arr.length - 1;
            while (idx >= 0) {
                int temp = arr[idx];
                arr[idx] = max;
                max = Math.max(max, temp);
            }
            return arr;
        }
    }

    @Test
    public void test() {
        int[] NUMS = ArrayGenerator.getArray(100, 100);
        System.out.println(Arrays.toString(NUMS));
    }
}
